import React, { Component } from 'react'
import { Button } from 'antd'

// 高阶组件内 
const withName = (Comp) => {
    // 设置可以重写组件声明周期
    class NewComponent extends Component {
        render() {
            return (
                <div>
                    <Comp {...this.props} />
                    封装之后的
                </div>
            )
        }
    }
    return NewComponent
}


@withName
class Kaikba extends Component {
    render() {
        return (
            <div>基础组件 </div>
        )
    }
}

export default class App extends Component {
    render() {
        return (
            <div>
                <Button>哈哈</Button>
                <Kaikba />
            </div>
        )
    }
}
